package com.itfreer.cms.dao.content;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;

import org.springframework.beans.BeanUtils;

import com.itfreer.cms.dao.base.JdbcTreeEntityBase;
import com.itfreer.cms.entity.content.ColumnEntity;
import com.itfreer.form.api.JdbcBaseEntity;

/**
 * 定义栏目管理类
 */
@Entity(name = "cms_column")
public class JdbcColumnEntity extends JdbcTreeEntityBase implements JdbcBaseEntity<ColumnEntity>, Serializable {

	private static final long serialVersionUID = -3113990430827435245L;

	/**
	 * 站点名称
	 */
	@Column(name = "s_siteid", length = 20, nullable = true)
	private String siteId;
	
	/**
	 * 所属模块
	 */
	@Column(name = "s_mode", length = 20, nullable = true)
	private String mode;
	
	/**
	 * 创建日期
	 */
	@Column(name = "d_date", length = 20, nullable = true)
	private Date createDate;

	/**
	 * 推荐
	 */
	@Column(name = "b_recommend", length = 20, nullable = true)
	private Boolean recommend;

	/**
	 * 图片说明
	 */
	@Column(name = "s_image", length = 50, nullable = true)
	private String image;

	public String getSiteId() {
		return siteId;
	}

	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}
	
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Boolean getRecommend() {
		return recommend;
	}

	public void setRecommend(Boolean recommend) {
		this.recommend = recommend;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
	public String getMode() {
		return mode;
	}

	public void setMode(String mode) {
		this.mode = mode;
	}
	
	@Override
	public void from(ColumnEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public ColumnEntity toEntity() {
		ColumnEntity toEntity = new ColumnEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}
